package day0720;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class UserServiceImpl implements UserService{
    @Override
    public boolean register(User user) throws IOException {
        System.out.println("请输入用户名");
        System.out.println("请输入密码");
        System.out.println("请输入姓名");
        Scanner scanner = new Scanner(System.in);
        String username = scanner.next();
        String password = scanner.next();
        String name = scanner.next();
        FileWriter fw = new FileWriter("D\\张三.txt");
        BufferedWriter bw = new BufferedWriter(fw);
        BufferedWriter bw2 = new BufferedWriter(fw);
        BufferedWriter bw3 = new BufferedWriter(fw);
        bw.write(username+"\n");
        bw2.write(password);
        bw3.write(name);
        bw.close();
        return false;
    }

    @Override
    public boolean login(String username, String password) {
        return false;
    }
}
